<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>物资库存查询列表</title>
		<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/list.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/layui.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/jquery-ui.css" />
		<link rel="stylesheet" href="../../css/ztree/zTreeStyle.css" type="text/css">
		<style>
			.org_window {
				width: 400px;
				height: 300px;
				text-align: center;
				position: absolute;
				top: 35%;
				left: 45%;
				margin-left: -150px;
				margin-top: -100px;
				background: rgb(245, 245, 245);
				border: 1px solid rgb(200, 200, 200);
				box-shadow: 5px 5px 5px rgb(100, 100, 100);
			}
			
			.org_window p {
				text-align: center;
				height: 30px;
				background: rgb(68, 161, 248);
				line-height: 30px;
				color: white;
				margin-bottom: 10px;
			}
			.td_with {
				width: 243px;
			}
			
		</style>
	</head>
	<body>
		<!-- 蓝色背景区域 -->
		<div class="wrap">
			<!-- 白色可用区域 -->
			<div class="canuse">
				<!------ 位置 ------>
	            <p class="contentText local"><span>位置：物资查询 > 物资库存查询</span></p>
	            
            	<!-- 搜索区 -->
	            <div class="search_area">
                    <h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>物资库存查询条件</span></h4>
                    <div class="select_area">
                        <div class="select_text clear">
                        	<div class="label_input">
	                            <label class="contentText">物资编码：</label> <input type="text" name="" id="" value="" />
                        	</div>
                        	<div class="label_input">
	                            <label class="contentText">物资名称：</label> <input type="text" name="" id="" value="" />
                        	</div>
                        	<div class="label_input">
	                            <label class="contentText">物资类型：</label> 
	                            <select name="" id="" value="" >
	                            	<option>--请选择--</option>
	                            	<option>类型1</option>
	                            	<option>类型2</option>
	                            </select>
                        	</div>
                        	<div class="label_input">
	                            <label class="contentText">规格型号：</label> <input type="text" name="" id="" value="" />
                        	</div>
                        	<div class="label_input">
	                            <label class="contentText">所属仓库：</label> 
	                            <select name="" id="" value="" >
	                            	<option>--请选择--</option>
	                            	<option>仓库A</option>
	                            	<option>仓库B</option>
	                            </select>
                        	</div>
                        	
                        	<div class="label_input">
	                            <label class="contentText">产品代号：</label> <input type="text" name="" id="" value="" />
                        	</div>
                        	<div class="label_input">
	                            <label class="contentText">零部件代号：</label> <input type="text" name="" id="" value="" />
                        	</div>
                            <div class="floatLeft">
	                            <button class="btn_search bgd_blue_search">查询</button>
	                            <button class="btn_clear bgd_white_clear">重置</button>
                            </div>
                        </div>
                    </div>
	            </div>
	            
	            <!-- 列表区 -->
	            <div class="show_list">
                	<div class="title_operate">
                    	<h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>物资库存列表</span></h4>
                	</div>
                	<div class="list_area">
                        <!-- 信息列表区 -->
                        <div class="info_area">
                            <table class="tablelist" border="1" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
                                <tbody>
                                    <tr class="menuText list_head">
                                        <th class="">序号</th>
                                        <th class="">物资编码</th>
                                        <th class="">物资名称</th>
                                        <th class="">库存数量</th>
                                        <th class="">锁定数量</th>
                                        <th class="">可用数量</th>
                                        <th class="">物资类型</th>
                                        <th class="">规格型号</th>
                                        <th class="">计量单位</th>
                                        <th class="">所属仓库</th>
                                    </tr>
                                </tbody>
                                <tbody class="tablelist tbody_hover">
                                    <tr class="listTableText list_list">
                                        <td>1</td>
                                        <td><a onclick="showDetail()">pz001</a></td>
                                        <td>pz001</td>
                                        <td>500</td>
                                        <td>20</td>
                                        <td>100</td>
                                        <td>类型1</td>
                                        <td>型号A</td>
                                        <td>个</td>
                                        <td>仓库A</td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                        <td>2</td>
                                        <td><a onclick="showDetail()">pz002</a></td>
                                        <td>pz002</td>
                                        <td>500</td>
                                        <td>20</td>
                                        <td>100</td>
                                        <td>类型1</td>
                                        <td>型号A</td>
                                        <td>个</td>
                                        <td>仓库B</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
	                    <!-- 页码区域 -->
	                    <div class="page_area contentText clear">
	                    	<div class="page_sum">
	                    		共<span class="page_number"> 3 </span>页&emsp;每页 10 条&emsp;共<span class="info_sum"> 27 </span>条记录
	                    	</div>
	                        <div class="page_jump">
	                        	<span>跳转到&emsp;第</span>
	                        	<input type="text" name="" id="" value="" />
	                        	<span>页&emsp;</span>
	                        	<button>Go</button>
	                        </div>
	                        <div class="page-pull-right async-page">
	                            <button>上一页</button>
	                            <button class="select_page">1</button>
	                            <button>2</button>
	                            <button>3</button>
	                            <button style="color: rgb(30, 30, 30);">▪▪▪</button>
	                            <button>98</button>
	                            <button>99</button>
	                            <button>100</button>
	                            <button>下一页</button>
	                        </div>
	                    </div>
                    </div>
                </div>
                
                <div class="show_list" id="inventoryDetail">
                	<div class="title_operate">
                    	<h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>物资库存详情</span></h4>
                	</div>
                	<div class="list_area">
                        <!-- 信息列表区 -->
                        <div class="info_area">
                            <table class="tablelist" border="1" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
                                <tbody>
                                    <tr class="menuText list_head">
                                    	<th class="checkSelectAll">全选</th>
                                        <th class="">序号</th>
                                        <th class="">物资编码</th>
                                        <th class="">库存数量</th>
                                        <th class="">锁定数量</th>
                                        <th class="">可用数量</th>
                                        <th class="">批次号</th>
                                        <th class="">合格证编号</th>
                                        <th class="">存放库位</th>
                                        <th class="">入库日期</th>
                                        <th class="">失效日期</th>
                                         <th class="">物料用途</th>
                                    </tr>
                                </tbody>
                                <tbody class="tablelist tbody_hover">
                                    <tr class="listTableText list_list">
                                    	<td><input type="checkbox"></td>
                                        <td>1</td>
                                        <td>pz001</td>
                                        <td>500</td>
                                        <td>20</td>
                                        <td>100</td>
                                        <td>2020010810</td>
                                        <td>qaf032</td>
                                        <td>006</td>
                                        <td>2020-01-17</td>
                                        <td>2020-01-17</td>
                                          <td><a class="editBlue cursor" href="javascript:$('#viewMaterialUsage').show()">查看</a> <a class="editBlue cursor" href="javascript:$('#selectMaterialUsage').show()">编辑</a></td>
                                    </tr>
                                    <tr class="listTableText list_list">
                                    	<td><input type="checkbox"></td>
                                        <td>2</td>
                                        <td>pz001</td>
                                        <td>500</td>
                                        <td>20</td>
                                        <td>100</td>
                                        <td>2020010818</td>
                                        <td>qaf032</td>
                                        <td>003</td>
                                        <td>2020-01-17</td>
                                        <td>2020-01-17</td>
                                       <td><a class="editBlue cursor" href="javascript:$('#viewMaterialUsage').show()">查看</a> <a class="editBlue cursor" href="javascript:$('#selectMaterialUsage').show()">编辑</a></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
	                    <!-- 页码区域 -->
	                    <div class="page_area contentText clear">
	                    	<div class="page_sum">
	                    		共<span class="page_number"> 3 </span>页&emsp;每页 10 条&emsp;共<span class="info_sum"> 27 </span>条记录
	                    	</div>
	                        <div class="page_jump">
	                        	<span>跳转到&emsp;第</span>
	                        	<input type="text" name="" id="" value="" />
	                        	<span>页&emsp;</span>
	                        	<button>Go</button>
	                        </div>
	                        <div class="page-pull-right async-page">
	                            <button>上一页</button>
	                            <button class="select_page">1</button>
	                            <button>2</button>
	                            <button>3</button>
	                            <button style="color: rgb(30, 30, 30);">▪▪▪</button>
	                            <button>98</button>
	                            <button>99</button>
	                            <button>100</button>
	                            <button>下一页</button>
	                        </div>
	                    </div>
                    </div>
                </div>
			</div>
			<!-- 版尾  -->
			<div class="ending">
				Copyright© 2019-2020 磐基技术有限公司
			</div>
			
				<!--选择产品用途-->
			<div id="viewMaterialUsage" class="mask hidden">
					<div class="org_window" style="">
						<p>查看物料用途</p>
						<div class="article_list" style="width: 95%;height: 70%;  margin: 0px auto;overflow-y: scroll;overflow-x: hidden;">
							<!------- 添加内容 ------->
							<div class="content content1">
								<!-- 用户列表内容区 -->
								<div class="con con_01">
									<div class="write_area" style="height: 90%; ">
										<div id="productTree1" class="ztree"></div>
									</div>
								</div>
							</div>
						</div>
						<!-- 保存、重置按钮区 -->
						<div align="center" class="btn_submit" style="margin-top: 10px;">
							<a href="javascript:$('#viewMaterialUsage').hide()" class="bgd_white_two img_hand">关闭</a>
						</div>
					</div>
				</div>
			
			<!--选择产品用途-->
			<div id="selectMaterialUsage" class="mask hidden">
					<div class="org_window" style="">
						<p>选择物料用途</p>
						<div class="article_list" style="width: 95%;height: 70%;  margin: 0px auto;overflow-y: scroll;overflow-x: hidden;">
							<!------- 添加内容 ------->
							<div class="content content1">
								<!-- 用户列表内容区 -->
								<div class="con con_01">
									<div class="write_area" style="height: 90%; ">
										<div id="productTree2" class="ztree"></div>
									</div>
								</div>
							</div>
						</div>
						<!-- 保存、重置按钮区 -->
						<div align="center" class="btn_submit" style="margin-top: 10px;">
							<a href="javascript:$('#selectMaterialUsage').hide()" class="bgd_blue_two img_hand save">确定</a>
							<a href="javascript:$('#selectMaterialUsage').hide()" class="bgd_white_two img_hand">关闭</a>
						</div>
					</div>
				</div>
				
			
			
			<!-- 等待加载 -->
			<!--<div class="loader"><p class="load_hint">请等待加载••••••</p></div>-->
			
		</div>
	</body>
	<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="../../js/3rd/ztree/jquery.ztree.core.product-3.5.js"></script>
	<script type="text/javascript" src="../../js/3rd/ztree/jquery.ztree.excheck-3.5.js"></script>
	<script type="text/javascript" src="../../js/3rd/ztree/jquery.ztree.exedit-3.5.js"></script>
	<script src="../../js/frame/common.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/3rd/jquery-ui.js" type="text/javascript"></script>
	<script type="text/javascript">
		var h = document.documentElement.clientHeight;
		$(".wrap").css("height", h);
		
		// 获取每行 td 的兄弟节点
		$("td").hover(   
			function () {      
				$(this).parent().children().addClass("td_hover");
			},    
			function () {      
				$(this).parent().children().removeClass("td_hover");   
			}
		);
		
		// 日期控件
		$(function(){
	        $("#dateControl").datepicker({
	        	dateFormat : 'yy-mm-dd',
	            monthNamesShort:["January","February","March","April","May","June", "July","August","September","October","November","December"],
	 		 	changeYear:true,
	 		 	changeMonth:true,
	 		 	showOn:"button",
	 		 	buttonImage:"../../img/button/calendar.png",
	 		 	buttonImageOnly:false
	        });
	     });
	     $(function(){
	        $("#dateControl1").datepicker({
	        	dateFormat : 'yy-mm-dd',
	            monthNamesShort:["January","February","March","April","May","June", "July","August","September","October","November","December"],
	 		 	changeYear:true,
	 		 	changeMonth:true,
	 		 	showOn:"button",
	 		 	buttonImage:"../../img/button/calendar.png",
	 		 	buttonImageOnly:false
	        });
	        
	        $("#inventoryDetail").hide();
	     });
	     
	    function showDetail(){
	    	$("#inventoryDetail").show();
	    }
		
		
		//删除规则
	    function delUserGroup() {
			
	        var list = [];
	        var checks = $("input[name='ids']:checked");
	        $.each(checks, function(index, obj) {
	            list.push(obj.id);
	        });
	        if (!list.length > 0) {
	            alert("请选择要删除的内容");
	            return;
	        }
	        if (!confirm("确定要删除所选用户组吗？")) {
	            return;
	        }
	        alert("提醒:删除时，正在使用的用户组将无法删除！");
	        $.ajax({
	            type : 'POST',
	            url : 'userGroup/delUserGroup',
	            data : JSON.stringify(list),
	            contentType : 'application/json; charset=utf-8',
	            async : true,
	            cache : false,
	            success : function(data) {
	                alert(data == 'success' ? "删除成功" : "被使用：无法删除!!!");
	                if (data != 'success') {
	                    return;
	                }
	
	                var current = PageUtils._currentPage['userGroupPage'];
	                PageUtils.pageClick(current, 'userGroupPage');
	            }
	
	        });
	    }
	    
	    
	    
	    /* 零部件信息管理 */
		var setting = {
			check: {
				enable: true,
				autoCheckTrigger: true,
				chkboxType:{ "Y": "", "N": "" }
			},
			data: {
	            key:{
	                name:"name"
	            },
	            simpleData: {
	                enable: true,
	                idKey:"id",
	                pIdKey:"pId"
	            }
        	}
		};
		
		
		function getZNodes(type){
			var flag = type == 1 ? true:false;
			var zNodes =[
				{ id:1, pId:0, name:"产品1", open:true,checked:true,chkDisabled:flag},
				{ id:11, pId:1, name:"零件 1-1",checked:true,chkDisabled:flag},
				{ id:12, pId:1, name:"零件 1-2",checked:true,chkDisabled:flag},
				{ id:13, pId:1, name:"零件 1-3",checked:true,chkDisabled:flag},
				{ id:2, pId:0, name:"产品 2", open:true,chkDisabled:flag},
				{ id:21, pId:2, name:"零件 2-1",chkDisabled:flag},
				{ id:22, pId:2, name:"零件 2-2",chkDisabled:flag},
				{ id:3, pId:0, name:"产品 3", open:true,chkDisabled:flag},
				{ id:31, pId:3, name:"零件 3-1",chkDisabled:flag},
				{ id:32, pId:3, name:"零件 3-2",chkDisabled:flag},
				{ id:33, pId:3, name:"零件 3-3",chkDisabled:flag}
			];
			return zNodes;
		}

		
		
		/* 初始化数据 */
			$.fn.zTree.init($("#productTree1"), setting, getZNodes(1));
			$("#productTree1 img").hide();
			
			/* 初始化数据 */
			$.fn.zTree.init($("#productTree2"), setting, getZNodes(2));
			$("#productTree2 img").hide();
	    
	</script>
</html>
